<template>
	<view class="load-more">
		<view v-if="status === 'more'" @click="handleClick">
			<slot>
				<view class="more">
					<text>更多</text>
					<image mode="scaleToFill" src="/static/imgs/more-lives.png"></image>
				</view>
			</slot>
		</view>
		
		<view class="loading" v-if="status === 'loading'">
			<u-loading-icon size="12" text="正在加载" textSize="12" textColor="#707070"></u-loading-icon>
		</view>
		
		<view class="no-more" v-if="status === 'nomore'">
			
		</view>
	</view>
</template>

<script>
	export default {
		name: "More",
		props: {
			// 状态，more 为加载更多，loading 为加载中，nomore 为已加载全部
			status: {
				type: String,
				default: 'more'
			}
		},
		data() {
			return {

			};
		},
		methods: {
			handleClick() {
				this.$emit('more')
			}
		}
	}
</script>

<style scoped lang="scss">
	.load-more {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		

		.more {
			padding: 12rpx 0;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			text {
				margin-right: 10rpx;
				font-size: 12px;
				color: #707070;
			}

			image {
				width: 26rpx;
				height: 26rpx;
			}
		}
	}
</style>
